﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Collections;

namespace SchemaMonitor.json
{
    [DataContract]
    public class CFieldString : CField
    {
        //Members
        [DataMember(Order = 1)] public List<string> Strings;

        //Constructor
        public CFieldString(CNodeBasic parent, CTag tag, object value) : base(parent, tag)
        {
            this.Value = value;
        }
        //Serialisation Constructors
        private CFieldString() { }
        static CFieldString() { ProtoBuf.Serializer.PrepareSerializer<CFieldString>(); }
        
        //Must Override
        public override IList List { get { return Strings; } set { Strings = value.Cast<string>().ToList(); } }
        protected override IList InitList() { return new List<string>(); }
        protected override IList InitList(object[] array) { return array.Cast<string>().ToList(); }

    }
}
